from modelo import Greeting
from google.appengine.ext import webapp
from google.appengine.api import users

class Sign(webapp.RequestHandler):
  def post(self):
    """
    """
    query = Greeting().all()
    query.filter("author", users.get_current_user())
    # Recuperamos el numero de mensajes del usuario
    if query.count() > 5:
        self.redirect ('/nomore')
    else:
        greeting = Greeting()
        if (users.get_current_user):
            greeting.author = users.get_current_user()
        greeting.content = self.request.get('content')
        greeting.put()
        self.redirect("/")